<template>
  <div class="container">{{ message }}
    <h1 v-if="error.statusCode === 404">{{ message }}</h1>
    <h1 v-else>An error occurred</h1>
  </div>
</template>

<script>
export default {
  name: 'page-error',
  props: ['error'],
  computed: {
    statusCode () {
      return (this.error && this.error.statusCode) || 500
    },
    message () {
      return this.error.message || 'Error'
    }
  }
}
</script>
